package com.qkl.xiatang.app.utils.appenum;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 *  传感器正常值 ,0 电池电压,1 pH值,2 盐度,3 水温,4 溶解氧,5 氨氮,6 亚硝酸盐
 */
@Getter
public enum SensorTypeNormalEnum {

    A1(3,"水温","water_temp"),
    A2(2,"盐度","salinity"),
    A3(1,"PH","ph"),
    A4(4,"溶氧","do1"),
    A5(6,"亚盐","no2"),
    A6(5,"氨氮","nh3_no2"),
    ;

    private SensorTypeNormalEnum(Integer type,String name,String fieldName){
        this.type = type;
        this.name = name;
        this.fieldName = fieldName;
        EnumUtil.typeMap.put(type,this);
    }

    private Integer type;
    private String name;
    private String fieldName;

    public static  SensorTypeNormalEnum getEnum(Integer type){
        return EnumUtil.typeMap.get(type);
    }


    private static  class EnumUtil{
        public static Map<Integer,SensorTypeNormalEnum> typeMap = new HashMap<>();
    }


}
